package com.fortune.dao;

import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.fortune.dto.in.distributorOrder.DistributorOrderAddDto;
import com.fortune.dto.in.distributorOrder.DistributorOrderDetailAddDto;
import com.fortune.dto.in.distributorOrder.DistributorOrderEditDto;
import com.fortune.dto.in.distributorOrder.DistributorOrderListDto;
import com.fortune.entity.MProductInfo;
import com.fortune.entity.MUserInfo;
import com.fortune.vo.distributorOrderMgt.DistributorOrder;
import com.fortune.vo.distributorOrderMgt.DistributorOrderDetail;
import com.fortune.vo.distributorOrderMgt.Product;
import com.fortune.vo.distributorOrderMgt.ProductDetail;

public interface DistributorOrderMgtDao {
	/**
	 * 经销商订单列表
	 * @param distributorOrderMgtListDto
	 * @return
	 */
	List<DistributorOrder> list(@Param("mUserInfo")MUserInfo mUserInfo,@Param("distributorOrderMgtListDto")DistributorOrderListDto distributorOrderMgtListDto,@Param("type")String type);
	
	int count(@Param("mUserInfo")MUserInfo mUserInfo,@Param("distributorOrderMgtListDto")DistributorOrderListDto distributorOrderMgtListDto,@Param("type")String type);
	
	/**
	 * 经销商订单详情
	 * @param mId
	 * @param dId
	 * @param orderId
	 * @return
	 */
	DistributorOrderDetail detail(@Param("mId")String mId,@Param("dId")String dId,@Param("orderId")String orderId);
	
	MProductInfo dProductInfo(@Param("mId")String mId,@Param("productId")String productId, @Param("dId")String dId);
	
	int add(@Param("addDto")DistributorOrderAddDto addDto,@Param("mId")String mId,@Param("createUser")String createUser,@Param("id")String id,@Param("pTotalPrice")BigDecimal pTotalPrice,@Param("dTotalPrice")BigDecimal dTotalPrice);
	
	int addDetail(@Param("detailAddDto")DistributorOrderDetailAddDto detailAddDto,@Param("mId")String mId,@Param("dId")String dId,@Param("id")String id,@Param("i")int i);
	
	int edit(@Param("editDto")DistributorOrderEditDto editDto,@Param("mId")String mId,@Param("createUser")String createUser,@Param("pTotalPrice")BigDecimal pTotalPrice,@Param("dTotalPrice")BigDecimal dTotalPrice);
	
	int deleteDetal(@Param("mId")String mId,@Param("dId")String dId,@Param("id")String id);
	
	int delete(@Param("mId")String mId,@Param("dId")String dId,@Param("orderId")String orderId);
	
	int approve(@Param("mId")String mId,@Param("dId")String dId,@Param("orderId")String orderId,@Param("shipStore")String shipStore,@Param("createUser")String createUser);
	
	List<Product> productDetails(@Param("mId")String mId,@Param("dId")String dId,@Param("orderId")String orderId);
	
	int storeCount(@Param("mId")String mId,@Param("id")String id,@Param("shipStore")String shipStore);
	
	int outCount(@Param("mId")String mId,@Param("id")String id,@Param("shipStore")String shipStore);
	
	int transCount(@Param("mId")String mId,@Param("id")String id,@Param("shipStore")String shipStore);
	
	int addOut(@Param("detail")DistributorOrderDetail detail,@Param("uuid")String uuid,@Param("shipStore")String shipStore,@Param("shipUser")String shipUser,@Param("aa")String aa);
	
	int addOutDetail(@Param("producDetail")ProductDetail producDetail,@Param("mId")String mId,@Param("uuid")String uuid);
	
	String shipUser(@Param("mId")String mId,@Param("shipStore")String shipStore);

	Integer findOutNum(@Param("mid")String mid);

	int findNO(@Param("mid")String mid,@Param("did")String did,@Param("identification")int identification,@Param("orderId")String orderId,@Param("no")String no);
}
